Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vm-runner: external traffic Prometheus metrics endpoint #1153

Merged
merged 8 commits into from
Dec 6, 2024

Conversation

myrrc
Copy link
Contributor

@myrrc myrrc commented Nov 21, 2024

Add /metrics Prometheus endpoint to neonvm-runner
exposing following metrics:
runner_vm_egress_bytes
runner_vm_ingress_bytes
runner_vm_network_fetch_errors_total
_bytes metrics use iptables and query rules configured in
https://github.com/neondatabase/cloud/blob/main/compute-init/compute-init.sh#L143

Resolves: neondatabase/neon#4704

@myrrc myrrc requested a review from sharnoff November 21, 2024 15:14
Copy link

github-actions bot commented Nov 21, 2024

No changes to the coverage.

HTML Report

Click to open

@myrrc myrrc marked this pull request as ready for review November 25, 2024 15:55
@myrrc myrrc requested a review from vadim2404 November 25, 2024 19:41
Copy link
Member

@sharnoff sharnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! Here's some initial review, leaving out the autoscaler-agent changes for now, pending discussion on how we actually want to consume the network usage data.

neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm/apis/neonvm/v1/virtualmachine_types.go Outdated Show resolved Hide resolved
neonvm/apis/neonvm/v1/virtualmachine_types.go Outdated Show resolved Hide resolved
neonvm/apis/neonvm/v1/virtualmachine_types.go Outdated Show resolved Hide resolved
neonvm/apis/neonvm/v1/virtualmachine_types.go Outdated Show resolved Hide resolved
neonvm/apis/neonvm/v1/virtualmachine_types.go Show resolved Hide resolved
@myrrc myrrc force-pushed the 4704/iptables-traffic-metering branch 2 times, most recently from 5086879 to 81b6d85 Compare November 26, 2024 11:29
@myrrc myrrc requested a review from sharnoff November 26, 2024 18:34
@myrrc myrrc enabled auto-merge (squash) November 27, 2024 11:07
@myrrc myrrc disabled auto-merge November 27, 2024 11:07
@myrrc myrrc enabled auto-merge (squash) November 27, 2024 11:08
@myrrc myrrc force-pushed the 4704/iptables-traffic-metering branch from 2656666 to b5822bd Compare November 27, 2024 15:19
@sharnoff sharnoff disabled auto-merge November 27, 2024 15:21
@myrrc myrrc force-pushed the 4704/iptables-traffic-metering branch 2 times, most recently from bb5b06e to 3c00112 Compare November 28, 2024 14:53
Copy link
Member

@sharnoff sharnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review, looking good.

neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
@myrrc myrrc force-pushed the 4704/iptables-traffic-metering branch from 3c00112 to a12df78 Compare December 3, 2024 10:33
@myrrc myrrc requested a review from sharnoff December 3, 2024 10:33
@myrrc myrrc force-pushed the 4704/iptables-traffic-metering branch from a12df78 to 1d1193a Compare December 5, 2024 11:56
@myrrc myrrc changed the title vm-runner: iptables-based traffic metering vm-runner: external traffic Prometheus metrics endpoint Dec 5, 2024
Copy link
Member

@sharnoff sharnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last review, after this it should be good

neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Show resolved Hide resolved
@myrrc myrrc requested a review from sharnoff December 5, 2024 16:45
Copy link
Member

@sharnoff sharnoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, pending resolution of the comments

neonvm-runner/cmd/main.go Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Show resolved Hide resolved
Copy link
Contributor

@Omrigan Omrigan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of nits, overall looks good.

neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
neonvm-runner/cmd/main.go Outdated Show resolved Hide resolved
@myrrc myrrc enabled auto-merge (squash) December 6, 2024 13:28
@myrrc myrrc removed the request for review from vadim2404 December 6, 2024 13:29
@myrrc myrrc merged commit 30eee9a into main Dec 6, 2024
22 checks passed
@myrrc myrrc deleted the 4704/iptables-traffic-metering branch December 6, 2024 13:47
myrrc added a commit that referenced this pull request Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add traffic metering in/out Internet
3 participants